{% extends 'oscar/dashboard/offers/step_form.html' %}


{% load i18n %}

{% block progress %}
    {% include 'oscar/dashboard/offers/progress.html' with step=2 %}
{% endblock %}

{% block form_fields %}
    <span class="error-block">{{ form.non_field_errors }}</span>

    {% if form.fields.custom_benefit.choices %}
        <h4>{% trans "Build a new incentive" %}</h4>
    {% endif %}
    {% include "oscar/dashboard/partials/form_field.html" with field=form.range %}
    <p>
        {% url 'dashboard:range-list' as range_list_url %}
        {% blocktrans %}
        Ranges can be created and edited from within the <a href="{{ range_list_url }}" target="_blank">range dashboard</a>.
        {% endblocktrans %}
    </p>
    {% include "oscar/dashboard/partials/form_field.html" with field=form.type %}
    {% include "oscar/dashboard/partials/form_field.html" with field=form.value %}
    {% include "oscar/dashboard/partials/form_field.html" with field=form.max_affected_items %}

    {% if form.fields.custom_benefit.choices %}
        <h4>{% trans "...or choose a pre-defined one" %}</h4>
        {% include "oscar/dashboard/partials/form_field.html" with field=form.custom_benefit %}
    {% endif %}
{% endblock %}

{% block submittext %}{% trans "Continue to step 3" %}{% endblock %}

{% block onbodyload %}
    {{ block.super }}
    oscar.dashboard.offers.init();
{% endblock %}
